package com.tao.drop.service;

import com.tao.drop.dao.impl.DropMapperImp;
import com.tao.drop.domain.People;

import java.util.List;

/**
 * Created by tao on 2017/8/24.
 */
public class DropService {

    public String sayHiToSomeOne (int age) {
        DropMapperImp dropMapperImp = new DropMapperImp();
        List<People> peoples = dropMapperImp.selectAll(age);
        People someone = peoples.get(0);
        String sayHi = "Hello ! " + someone.getName() + " your age is " + someone.getAge();
        return sayHi;
    }

    public String sayGoodByeToSomeOne (int age) {
        DropMapperImp dropMapperImp = new DropMapperImp();
        List<People> peoples = dropMapperImp.selectAll(age);
        People someone = peoples.get(0);
        String sayHi = "Bye ! " + someone.getName() + " your age is " + someone.getAge();
        return sayHi;
    }
}
